using OracleInternal.I18N;

namespace OracleInternal.Network
{
	internal class RefusePacket : Packet
	{
		internal int m_userReason;

		internal int m_systemReason;

		private string m_data;

		internal string Data => m_data;

		internal RefusePacket(Packet pkt)
			: base(pkt)
		{
			m_userReason = m_dataBuffer[TNSPacketOffsets.NSPRFURS];
			m_systemReason = m_dataBuffer[TNSPacketOffsets.NSPRFSRS];
			m_dataOffset = TNSPacketOffsets.NSPRFDAT;
			m_dataLength = m_dataBuffer[TNSPacketOffsets.NSPRFLEN] & 0xFF;
			m_dataLength <<= 8;
			m_dataLength |= m_dataBuffer[TNSPacketOffsets.NSPRFLEN + 1] & 0xFF;
			byte[] array = ExtractData();
			if (array != null)
			{
				m_data = Conv.GetInstance(871).ConvertBytesToString(array, 0, array.Length);
			}
		}
	}
}
